<table class="table table-responsive" id="categoryStatistics-table">
    <thead>
        <th>日期</th>
        <th>分类</th>
        <th>类型</th>
        <th>商品出售数量</th>
        <th>商品出售金额</th>
        <th>商品退货数量</th>
        <th>商品退货金额</th>
        <th>商品退货率</th>
        <th colspan="3">操作</th>
    </thead>
    <tbody>
    @foreach($categoryStatistics as $v)
        <tr>
            <td>{!! $v->date !!}</td>
            <td>
            @if($v->category)
                {{ $v->category->name }}
            @else
                该分类已删除
            @endif
            </td>
            <td>
                @if ($v->type == 1)
                    天统计
                @elseif ($v->type == 2)
                    周统计
                @elseif ($v->type == 3)
                    月统计
                @elseif ($v->type == 4)
                    季统计
                @elseif ($v->type == 5)
                    年统计
                @elseif ($v->type == 6)
                    全统计
                @endif
            </td>
            <td>{!! $v->goods_count !!}</td>
            <td>{!! $v->goods_amount !!}</td>
            <td>{!! $v->goods_return_count !!}</td>
            <td>{!! $v->goods_return_amount !!}</td>
            <td>{!! $v->goods_return_rate !!}</td>
            <td>
                {!! Form::open(['route' => ['categoryStatistics.destroy', $v->id], 'method' => 'delete']) !!}
                <div class='btn-group'>
                    <a href="{!! route('categoryStatistics.show', [$v->id]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-eye-open"></i></a>
{{--                    @if(date('Y-m-d')==$v->date)--}}
                        <a href="{!! route('categoryStatistics.refresh', [$v->id]) !!}" class='btn btn-default btn-xs'>更新</a>
                    {{--@endif--}}
                    {{--                    <a href="{!! route('categoryStatistics.edit', [$v->id]) !!}" class='btn btn-default btn-xs'><i class="glyphicon glyphicon-edit"></i></a>--}}
{{--                    {!! Form::button('<i class="glyphicon glyphicon-trash"></i>', ['type' => 'submit', 'class' => 'btn btn-danger btn-xs', 'onclick' => "return confirm('Are you sure?')"]) !!}--}}
                </div>
                {!! Form::close() !!}
            </td>
        </tr>
    @endforeach
    </tbody>
</table>